package net.sareweb.acab.entity;

// Generated 13-abr-2010 15:53:20 by Hibernate Tools 3.2.5.Beta

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.validator.NotNull;

/**
 * Match generated by hbm2java
 */
@Entity
@Table(name = "match", catalog = "acab")
public class Match implements java.io.Serializable {

	private Integer idMatch;
	private Travel travel;
	private Request request;
	private User user;
	private Date createDate;
	private Date seenDate;
	private Date rejectDate;

	public Match() {
	}

	public Match(Travel travel, Request request, User user, Date createDate) {
		this.travel = travel;
		this.request = request;
		this.user = user;
		this.createDate = createDate;
	}

	public Match(Travel travel, Request request, User user, Date createDate,
			Date seenDate, Date rejectDate) {
		this.travel = travel;
		this.request = request;
		this.user = user;
		this.createDate = createDate;
		this.seenDate = seenDate;
		this.rejectDate = rejectDate;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "idMatch", unique = true, nullable = false)
	public Integer getIdMatch() {
		return this.idMatch;
	}

	public void setIdMatch(Integer idMatch) {
		this.idMatch = idMatch;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "travel", nullable = false)
	@NotNull
	public Travel getTravel() {
		return this.travel;
	}

	public void setTravel(Travel travel) {
		this.travel = travel;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "request", nullable = false)
	@NotNull
	public Request getRequest() {
		return this.request;
	}

	public void setRequest(Request request) {
		this.request = request;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user", nullable = false)
	@NotNull
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "createDate", nullable = false, length = 0)
	@NotNull
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "seenDate", length = 0)
	public Date getSeenDate() {
		return this.seenDate;
	}

	public void setSeenDate(Date seenDate) {
		this.seenDate = seenDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "rejectDate", length = 0)
	public Date getRejectDate() {
		return this.rejectDate;
	}

	public void setRejectDate(Date rejectDate) {
		this.rejectDate = rejectDate;
	}

}
